package guda.sqladmin.web.form;

import guda.sqladmin.dao.domain.TableFieldDO;


public class TableFieldEditForm extends TableFieldForm {

    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public TableFieldDO toDO() {
        TableFieldDO tableFieldDO = super.toDO();
        tableFieldDO.setId(this.id);
        return tableFieldDO;
    }

    public void initForm(TableFieldDO tableFieldDO) {
        if (tableFieldDO == null) {
            return;
        }
        this.setTableId(tableFieldDO.getTableId());
        this.setFieldLength(tableFieldDO.getFieldLength());
        this.setDefaultValue(tableFieldDO.getDefaultValue());
        this.setFieldDesc(tableFieldDO.getFieldDesc());
        this.setNotNull(tableFieldDO.getNotNull());
        this.setFieldType(tableFieldDO.getFieldType());
        this.setFieldName(tableFieldDO.getFieldName());
        this.setIsKey(tableFieldDO.getIsKey());
        this.setIsAutoIncre(tableFieldDO.getIsAutoIncre());
    }

}
